<%@ page language="java" %>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page pageEncoding="utf-8" %>
<jsp:directive.include file="/WEB-INF/views/admin/include/taglibs.jsp"/>
<html>
<head>
<title>alleh map api3</title>
<script type="text/javascript" src="http://api.ktgis.com:10080/v3/olleh/mapAPI.js?key=ODEwMEQ4ODE6VDc3RkQ1NEMyMkM5NzBC"></script>
<script type="text/javascript">
function MapCtrl(){
	//console.log('Ctrl');
}
angular.module('nb.map.alleh', [])
.directive('allehMap', function() {
	return {
		//<div id="map_div" style="width:100%;height:100%;"></div>
		template: '<div id="map_div" style="width:300px;height:300px;"></div>',
		replace: true,
	    transclude: true,
	    restrict: 'E',
	    link: function(scope, element, attrs) {
		//	console.log('directive alleh-map link');
	       
			var mapOpts = {
				center: new olleh.maps.UTMK(958386.063532902, 1941447.5761742294),
				zoom: 9,
				mapTypeId: 'ROADMAP'
			};
			var map = new olleh.maps.Map(document.getElementById('map_div'), mapOpts);
	    }
	};
}).directive('nbHour',function(){
	return {
        restrict: 'A',
        link: function (scope, element, attrs) {
            scope.$watch(attrs.ngModel, function (v) {
                console.log('value changed, new value is: ' + v);
            });
        }
    };
});

</script>
</head>
<body>
	
	<div ng-app="nb.map.alleh">
		<div ng-controller="MapCtrl">
			<input nb-hour type="text" ng-model="hour"/>
			<alleh-map>sampleMap</alleh-map>
		</div>
	</div>
</body>
</html>